
#include "Base.h"

#include <string>

#include "Camera2DController.h"
#include "Maths/Matrix4.h"
#include "Game/Game.h"
#include "StringUtils.h"
#include "CameraController.h"

#include "Memory/DebugNew.h"


namespace CasaEngine
{

/**
 * 
 */
Camera2DController::Camera2DController(CameraComponent* pCamera)
	: ICameraController(pCamera),
	//m_bRecomputeViewMatrix(false),
	m_vPosition(Vector3F::Zero()),
	m_fRotation(0.0f)
{
	m_ViewMatrix.Identity();
}

/**
 * 
 */
Camera2DController::~Camera2DController()
{
}

/**
 * 
 */
void Camera2DController::Update(const GameTime& /*gameTime_*/)
{
	/*Matrix4 mat = m_pTransform->GetWorldMatrix();
	Vector3F pos3 = mat.GetTranslation();
	Vector2F pos(pos3.x, pos3.y);*/
}

/**
 * 
 */
void Camera2DController::Initialize()
{
	//m_pInputManager = Game::Instance()->GetGameComponent<InputManagerComponent>();
	//CASAENGINE_ASSERT(m_pInputManager != NULL && "ArcBallCameraController::Initialize() InputManagerComponent is NULL");
}

/**
 *
 */
Matrix4 Camera2DController::ViewMatrix()
{
	/*if (m_bRecomputeViewMatrix == true)
	{
		m_bRecomputeViewMatrix = false;
		m_ViewMatrix.LookAt(m_Target - (Direction() * m_fDistance), m_Target, Up());
	}*/

	return m_ViewMatrix;
}

/**
 * 
 */
/*void ICameraController::HandleEvent(const Event* pEvent_)
{

}*/

/**
 * 
 */
void Camera2DController::Write(std::ostream& /*os*/) const
{

}

/**
 * 
 */
void Camera2DController::Read (std::ifstream& /*is*/)
{

}

} // namespace CasaEngine
